/* HttpBaseController.java
 * 
 * class HttpBaseController
 */

package presentation.controller;

import java.util.Hashtable;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * class HttpBaseController
 * 
 * abstract class with the functionality and values for all requests handler
 * 
 * @date	08.06.2007
 * 
 */

public abstract class HttpBaseController {
	protected Hashtable<String, String> m_Arguments;
    protected HttpServletRequest m_Request;
    protected HttpServletResponse m_Response;
    protected ServletContext m_ServletContext;

	public abstract void process();
	
	public void setArguments(Hashtable<String, String> arguments) {
		m_Arguments = arguments;
	}

	public void setRequest(HttpServletRequest request) {
		m_Request = request;
	}

	public void setResponse(HttpServletResponse response) {
		m_Response = response;
	}

	public void setServletContext(ServletContext servletContext) {
		m_ServletContext = servletContext;
	}
	
	
	public void redirect() {
		redirect("response.jsp");
	}
	
	
	public void redirect(String target) {
		Redirect redirect = new Redirect();	
		redirect.setRequest(m_Request);
		redirect.setResponse(m_Response);
		redirect.setServletContext(m_ServletContext);
		redirect.setArguments(m_Arguments);
		redirect.dispatchTo(target);
	}
}//HttpBaseController

/*end of HttpBaseController.java*/

